export default function lazyRequire(requirePath) {
    debugger
    return {
        __lazyRequireFlag: true,
        __moduleId : requirePath,
        __loaded:false,
        __onModuleLoaded:undefined,

        load : function() {
            var module = require(this.__moduleId);
            if (!this.__loaded && this.__onModuleLoaded) {
                this.__onModuleLoaded(module);
            }
            this.__loaded = true;
            return module;
        },

        onModuleLoaded : function(moduleLoadCallback) {
            this.__onModuleLoaded = moduleLoadCallback;
        }
    }
}
